<?php

	function checkResult($result){
		if(!$result){
	    		die($message);
		}
	}

	if ($_SERVER['REQUEST_METHOD'] == 'GET') {
	
		mysql_connect("localhost","akosciak","MojaPtaszek");
		
		mysql_select_db("songbump") or die( "Unable to select database");
	
		$query = "SELECT Id FROM Users";
		$result = mysql_query($query);
		checkResult($result);

		// User Results
		$ids = array();
		while ($row = mysql_fetch_assoc($result)) {
			$ids[] = $row["Id"];
		}
		
		mysql_free_result($result);
			
		$idsJSON = json_encode($ids);
		echo $idsJSON;
		
	}
	
?>
